{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "provenance": [],
      "gpuType": "T4",
      "authorship_tag": "ABX9TyNIc4nRehHjNJlkYipgxq0t",
      "include_colab_link": true
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    },
    "language_info": {
      "name": "python"
    },
    "accelerator": "GPU"
  },
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "view-in-github",
        "colab_type": "text"
      },
      "source": [
        "<a href=\"https://colab.research.google.com/github/greengerong/awesome-llm/blob/main/colab/Yi_6B_demo.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "# 环境设置"
      ],
      "metadata": {
        "id": "29-lqsE7uSZf"
      }
    },
    {
      "cell_type": "code",
      "execution_count": 1,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "bmUdGqBluPMf",
        "outputId": "26d2248e-369f-49b6-b816-534b2304d8e8"
      },
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "/content\n",
            "Cloning into 'Yi'...\n",
            "remote: Enumerating objects: 112, done.\u001b[K\n",
            "remote: Counting objects: 100% (112/112), done.\u001b[K\n",
            "remote: Compressing objects: 100% (75/75), done.\u001b[K\n",
            "remote: Total 112 (delta 39), reused 87 (delta 24), pack-reused 0\u001b[K\n",
            "Receiving objects: 100% (112/112), 787.54 KiB | 5.79 MiB/s, done.\n",
            "Resolving deltas: 100% (39/39), done.\n",
            "/content/Yi\n",
            "Collecting deepspeed==0.11.1 (from -r requirements.txt (line 1))\n",
            "  Downloading deepspeed-0.11.1.tar.gz (1.1 MB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.1/1.1 MB\u001b[0m \u001b[31m14.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25h  Preparing metadata (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
            "Collecting transformers==4.34.0 (from -r requirements.txt (line 2))\n",
            "  Downloading transformers-4.34.0-py3-none-any.whl (7.7 MB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m7.7/7.7 MB\u001b[0m \u001b[31m107.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hCollecting sentencepiece==0.1.99 (from -r requirements.txt (line 3))\n",
            "  Downloading sentencepiece-0.1.99-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.3/1.3 MB\u001b[0m \u001b[31m88.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hCollecting accelerate==0.24.1 (from -r requirements.txt (line 4))\n",
            "  Downloading accelerate-0.24.1-py3-none-any.whl (261 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m261.4/261.4 kB\u001b[0m \u001b[31m36.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hCollecting auto-gptq==0.4.2 (from -r requirements.txt (line 5))\n",
            "  Downloading auto_gptq-0.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.8 MB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.8/1.8 MB\u001b[0m \u001b[31m98.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hCollecting datasets==2.14.5 (from -r requirements.txt (line 6))\n",
            "  Downloading datasets-2.14.5-py3-none-any.whl (519 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m519.6/519.6 kB\u001b[0m \u001b[31m58.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hCollecting optimum==1.13.2 (from -r requirements.txt (line 7))\n",
            "  Downloading optimum-1.13.2.tar.gz (300 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m301.0/301.0 kB\u001b[0m \u001b[31m43.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25h  Installing build dependencies ... \u001b[?25l\u001b[?25hdone\n",
            "  Getting requirements to build wheel ... \u001b[?25l\u001b[?25hdone\n",
            "  Preparing metadata (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n",
            "Collecting exllama==0.1.0 (from -r requirements.txt (line 8))\n",
            "  Downloading exllama-0.1.0-py3-none-any.whl (50 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m50.1/50.1 kB\u001b[0m \u001b[31m8.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hCollecting hjson (from deepspeed==0.11.1->-r requirements.txt (line 1))\n",
            "  Downloading hjson-3.1.0-py3-none-any.whl (54 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m54.0/54.0 kB\u001b[0m \u001b[31m8.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hCollecting ninja (from deepspeed==0.11.1->-r requirements.txt (line 1))\n",
            "  Downloading ninja-1.11.1.1-py2.py3-none-manylinux1_x86_64.manylinux_2_5_x86_64.whl (307 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m307.2/307.2 kB\u001b[0m \u001b[31m41.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hRequirement already satisfied: numpy in /usr/local/lib/python3.10/dist-packages (from deepspeed==0.11.1->-r requirements.txt (line 1)) (1.23.5)\n",
            "Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from deepspeed==0.11.1->-r requirements.txt (line 1)) (23.2)\n",
            "Requirement already satisfied: psutil in /usr/local/lib/python3.10/dist-packages (from deepspeed==0.11.1->-r requirements.txt (line 1)) (5.9.5)\n",
            "Requirement already satisfied: py-cpuinfo in /usr/local/lib/python3.10/dist-packages (from deepspeed==0.11.1->-r requirements.txt (line 1)) (9.0.0)\n",
            "Requirement already satisfied: pydantic<2.0.0 in /usr/local/lib/python3.10/dist-packages (from deepspeed==0.11.1->-r requirements.txt (line 1)) (1.10.13)\n",
            "Requirement already satisfied: torch in /usr/local/lib/python3.10/dist-packages (from deepspeed==0.11.1->-r requirements.txt (line 1)) (2.1.0+cu118)\n",
            "Requirement already satisfied: tqdm in /usr/local/lib/python3.10/dist-packages (from deepspeed==0.11.1->-r requirements.txt (line 1)) (4.66.1)\n",
            "Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from transformers==4.34.0->-r requirements.txt (line 2)) (3.13.1)\n",
            "Collecting huggingface-hub<1.0,>=0.16.4 (from transformers==4.34.0->-r requirements.txt (line 2))\n",
            "  Downloading huggingface_hub-0.18.0-py3-none-any.whl (301 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m302.0/302.0 kB\u001b[0m \u001b[31m39.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hRequirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.10/dist-packages (from transformers==4.34.0->-r requirements.txt (line 2)) (6.0.1)\n",
            "Requirement already satisfied: regex!=2019.12.17 in /usr/local/lib/python3.10/dist-packages (from transformers==4.34.0->-r requirements.txt (line 2)) (2023.6.3)\n",
            "Requirement already satisfied: requests in /usr/local/lib/python3.10/dist-packages (from transformers==4.34.0->-r requirements.txt (line 2)) (2.31.0)\n",
            "Collecting tokenizers<0.15,>=0.14 (from transformers==4.34.0->-r requirements.txt (line 2))\n",
            "  Downloading tokenizers-0.14.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.8 MB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.8/3.8 MB\u001b[0m \u001b[31m123.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hCollecting safetensors>=0.3.1 (from transformers==4.34.0->-r requirements.txt (line 2))\n",
            "  Downloading safetensors-0.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.3/1.3 MB\u001b[0m \u001b[31m64.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hCollecting rouge (from auto-gptq==0.4.2->-r requirements.txt (line 5))\n",
            "  Downloading rouge-1.0.1-py3-none-any.whl (13 kB)\n",
            "Collecting peft (from auto-gptq==0.4.2->-r requirements.txt (line 5))\n",
            "  Downloading peft-0.6.0-py3-none-any.whl (134 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m134.9/134.9 kB\u001b[0m \u001b[31m18.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hRequirement already satisfied: pyarrow>=8.0.0 in /usr/local/lib/python3.10/dist-packages (from datasets==2.14.5->-r requirements.txt (line 6)) (9.0.0)\n",
            "Collecting dill<0.3.8,>=0.3.0 (from datasets==2.14.5->-r requirements.txt (line 6))\n",
            "  Downloading dill-0.3.7-py3-none-any.whl (115 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m115.3/115.3 kB\u001b[0m \u001b[31m17.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hRequirement already satisfied: pandas in /usr/local/lib/python3.10/dist-packages (from datasets==2.14.5->-r requirements.txt (line 6)) (1.5.3)\n",
            "Requirement already satisfied: xxhash in /usr/local/lib/python3.10/dist-packages (from datasets==2.14.5->-r requirements.txt (line 6)) (3.4.1)\n",
            "Collecting multiprocess (from datasets==2.14.5->-r requirements.txt (line 6))\n",
            "  Downloading multiprocess-0.70.15-py310-none-any.whl (134 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m134.8/134.8 kB\u001b[0m \u001b[31m16.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hRequirement already satisfied: fsspec[http]<2023.9.0,>=2023.1.0 in /usr/local/lib/python3.10/dist-packages (from datasets==2.14.5->-r requirements.txt (line 6)) (2023.6.0)\n",
            "Requirement already satisfied: aiohttp in /usr/local/lib/python3.10/dist-packages (from datasets==2.14.5->-r requirements.txt (line 6)) (3.8.6)\n",
            "Collecting coloredlogs (from optimum==1.13.2->-r requirements.txt (line 7))\n",
            "  Downloading coloredlogs-15.0.1-py2.py3-none-any.whl (46 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m46.0/46.0 kB\u001b[0m \u001b[31m6.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hRequirement already satisfied: sympy in /usr/local/lib/python3.10/dist-packages (from optimum==1.13.2->-r requirements.txt (line 7)) (1.12)\n",
            "Collecting transformers[sentencepiece]>=4.26.0 (from optimum==1.13.2->-r requirements.txt (line 7))\n",
            "  Downloading transformers-4.35.0-py3-none-any.whl (7.9 MB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m7.9/7.9 MB\u001b[0m \u001b[31m95.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hCollecting ninja (from deepspeed==0.11.1->-r requirements.txt (line 1))\n",
            "  Downloading ninja-1.11.1-py2.py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (145 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m146.0/146.0 kB\u001b[0m \u001b[31m18.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hCollecting safetensors>=0.3.1 (from transformers==4.34.0->-r requirements.txt (line 2))\n",
            "  Downloading safetensors-0.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.3/1.3 MB\u001b[0m \u001b[31m75.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hRequirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets==2.14.5->-r requirements.txt (line 6)) (23.1.0)\n",
            "Requirement already satisfied: charset-normalizer<4.0,>=2.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets==2.14.5->-r requirements.txt (line 6)) (3.3.2)\n",
            "Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets==2.14.5->-r requirements.txt (line 6)) (6.0.4)\n",
            "Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets==2.14.5->-r requirements.txt (line 6)) (4.0.3)\n",
            "Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets==2.14.5->-r requirements.txt (line 6)) (1.9.2)\n",
            "Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets==2.14.5->-r requirements.txt (line 6)) (1.4.0)\n",
            "Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.10/dist-packages (from aiohttp->datasets==2.14.5->-r requirements.txt (line 6)) (1.3.1)\n",
            "Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.10/dist-packages (from huggingface-hub<1.0,>=0.16.4->transformers==4.34.0->-r requirements.txt (line 2)) (4.5.0)\n",
            "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests->transformers==4.34.0->-r requirements.txt (line 2)) (3.4)\n",
            "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests->transformers==4.34.0->-r requirements.txt (line 2)) (2.0.7)\n",
            "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests->transformers==4.34.0->-r requirements.txt (line 2)) (2023.7.22)\n",
            "Collecting huggingface-hub<1.0,>=0.16.4 (from transformers==4.34.0->-r requirements.txt (line 2))\n",
            "  Downloading huggingface_hub-0.17.3-py3-none-any.whl (295 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m295.0/295.0 kB\u001b[0m \u001b[31m32.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hRequirement already satisfied: networkx in /usr/local/lib/python3.10/dist-packages (from torch->deepspeed==0.11.1->-r requirements.txt (line 1)) (3.2.1)\n",
            "Requirement already satisfied: jinja2 in /usr/local/lib/python3.10/dist-packages (from torch->deepspeed==0.11.1->-r requirements.txt (line 1)) (3.1.2)\n",
            "Requirement already satisfied: triton==2.1.0 in /usr/local/lib/python3.10/dist-packages (from torch->deepspeed==0.11.1->-r requirements.txt (line 1)) (2.1.0)\n",
            "INFO: pip is looking at multiple versions of transformers[sentencepiece] to determine which version is compatible with other requirements. This could take a while.\n",
            "Collecting transformers[sentencepiece]>=4.26.0 (from optimum==1.13.2->-r requirements.txt (line 7))\n",
            "  Downloading transformers-4.34.1-py3-none-any.whl (7.7 MB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m7.7/7.7 MB\u001b[0m \u001b[31m124.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hRequirement already satisfied: protobuf in /usr/local/lib/python3.10/dist-packages (from transformers==4.34.0->-r requirements.txt (line 2)) (3.20.3)\n",
            "Collecting humanfriendly>=9.1 (from coloredlogs->optimum==1.13.2->-r requirements.txt (line 7))\n",
            "  Downloading humanfriendly-10.0-py2.py3-none-any.whl (86 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m86.8/86.8 kB\u001b[0m \u001b[31m14.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hRequirement already satisfied: python-dateutil>=2.8.1 in /usr/local/lib/python3.10/dist-packages (from pandas->datasets==2.14.5->-r requirements.txt (line 6)) (2.8.2)\n",
            "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas->datasets==2.14.5->-r requirements.txt (line 6)) (2023.3.post1)\n",
            "Requirement already satisfied: six in /usr/local/lib/python3.10/dist-packages (from rouge->auto-gptq==0.4.2->-r requirements.txt (line 5)) (1.16.0)\n",
            "Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.10/dist-packages (from sympy->optimum==1.13.2->-r requirements.txt (line 7)) (1.3.0)\n",
            "Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.10/dist-packages (from jinja2->torch->deepspeed==0.11.1->-r requirements.txt (line 1)) (2.1.3)\n",
            "Building wheels for collected packages: deepspeed, optimum\n",
            "  Building wheel for deepspeed (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
            "  Created wheel for deepspeed: filename=deepspeed-0.11.1-py3-none-any.whl size=1047110 sha256=544bb62b880c39199b0e8261c6ab8736b809543f87563ac501431ad97cabb0d2\n",
            "  Stored in directory: /root/.cache/pip/wheels/fc/a5/a7/bc3e8d6eea7ae73f7f3ea95f4caaba73a2853d70d5e8a9301a\n",
            "  Building wheel for optimum (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n",
            "  Created wheel for optimum: filename=optimum-1.13.2-py3-none-any.whl size=395598 sha256=22ceeba38774ad4c31f256e47b4d2fbe022743ac683f4dbb0cefa4881cb20334\n",
            "  Stored in directory: /root/.cache/pip/wheels/6e/b7/2c/79405d98f0943373d8546daeae25a3d377f7659ca0cbe48699\n",
            "Successfully built deepspeed optimum\n",
            "Installing collected packages: sentencepiece, safetensors, ninja, hjson, rouge, humanfriendly, dill, multiprocess, huggingface-hub, coloredlogs, tokenizers, exllama, deepspeed, accelerate, transformers, datasets, peft, optimum, auto-gptq\n",
            "Successfully installed accelerate-0.24.1 auto-gptq-0.4.2 coloredlogs-15.0.1 datasets-2.14.5 deepspeed-0.11.1 dill-0.3.7 exllama-0.1.0 hjson-3.1.0 huggingface-hub-0.17.3 humanfriendly-10.0 multiprocess-0.70.15 ninja-1.11.1 optimum-1.13.2 peft-0.6.0 rouge-1.0.1 safetensors-0.3.1 sentencepiece-0.1.99 tokenizers-0.14.1 transformers-4.34.0\n",
            "Collecting einops\n",
            "  Downloading einops-0.7.0-py3-none-any.whl (44 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m44.6/44.6 kB\u001b[0m \u001b[31m1.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hInstalling collected packages: einops\n",
            "Successfully installed einops-0.7.0\n"
          ]
        }
      ],
      "source": [
        "%cd /content\n",
        "!git clone https://github.com/01-ai/Yi.git\n",
        "%cd /content/Yi\n",
        "!pip install -r requirements.txt\n",
        "!pip install einops"
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "# Demo"
      ],
      "metadata": {
        "id": "aRknjTP5uq1k"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "!python demo/text_generation.py --model 01-ai/Yi-6B --tokenizer 01-ai/Yi-6B --max-tokens 512 --eos-token $'\\n' --streaming"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "T07Dau2_us12",
        "outputId": "c3652984-cd58-4496-efa7-7e133ee05026"
      },
      "execution_count": 7,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Namespace(model='01-ai/Yi-6B', tokenizer='01-ai/Yi-6B', max_tokens=512, streaming=True, prompt='Let me tell you an interesting story about cat Tom and mouse Jerry,', eos_token='\\n')\n",
            "Downloading (…)fetensors.index.json: 100% 22.9k/22.9k [00:00<00:00, 66.2MB/s]\n",
            "Downloading shards:   0% 0/2 [00:00<?, ?it/s]\n",
            "Downloading (…)of-00002.safetensors:   0% 0.00/9.94G [00:00<?, ?B/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:   0% 21.0M/9.94G [00:00<00:58, 170MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:   1% 52.4M/9.94G [00:00<00:40, 246MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:   1% 83.9M/9.94G [00:00<00:35, 275MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:   1% 115M/9.94G [00:00<00:34, 289MB/s] \u001b[A\n",
            "Downloading (…)of-00002.safetensors:   1% 147M/9.94G [00:00<00:34, 283MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:   2% 178M/9.94G [00:00<00:37, 259MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:   2% 210M/9.94G [00:00<00:36, 266MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:   2% 241M/9.94G [00:00<00:38, 254MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:   3% 273M/9.94G [00:01<00:40, 240MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:   3% 304M/9.94G [00:01<00:39, 245MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:   3% 336M/9.94G [00:02<02:29, 64.4MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:   4% 367M/9.94G [00:02<01:55, 82.7MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:   4% 388M/9.94G [00:02<01:45, 90.6MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:   4% 409M/9.94G [00:02<01:40, 94.5MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:   4% 440M/9.94G [00:03<01:21, 116MB/s] \u001b[A\n",
            "Downloading (…)of-00002.safetensors:   5% 472M/9.94G [00:03<01:05, 144MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:   5% 503M/9.94G [00:03<00:57, 164MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:   5% 535M/9.94G [00:03<00:50, 186MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:   6% 566M/9.94G [00:03<00:45, 207MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:   6% 598M/9.94G [00:03<00:41, 226MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:   6% 629M/9.94G [00:03<00:38, 240MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:   7% 661M/9.94G [00:03<00:36, 254MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:   7% 692M/9.94G [00:04<00:34, 265MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:   7% 724M/9.94G [00:04<00:33, 274MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:   8% 755M/9.94G [00:04<00:32, 283MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:   8% 786M/9.94G [00:04<00:32, 285MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:   8% 818M/9.94G [00:04<00:31, 286MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:   9% 849M/9.94G [00:04<00:31, 285MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:   9% 881M/9.94G [00:04<00:31, 284MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:   9% 912M/9.94G [00:04<00:31, 291MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:   9% 944M/9.94G [00:04<00:31, 288MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  10% 975M/9.94G [00:05<00:33, 268MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  10% 1.01G/9.94G [00:05<00:33, 269MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  10% 1.04G/9.94G [00:05<00:33, 267MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  11% 1.07G/9.94G [00:05<00:34, 260MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  11% 1.10G/9.94G [00:05<00:34, 259MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  11% 1.13G/9.94G [00:05<00:34, 259MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  12% 1.16G/9.94G [00:05<00:35, 250MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  12% 1.20G/9.94G [00:05<00:34, 254MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  12% 1.23G/9.94G [00:06<00:33, 258MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  13% 1.26G/9.94G [00:06<00:34, 255MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  13% 1.29G/9.94G [00:06<00:34, 249MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  13% 1.32G/9.94G [00:06<00:34, 252MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  14% 1.35G/9.94G [00:06<00:33, 253MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  14% 1.38G/9.94G [00:06<00:33, 255MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  14% 1.42G/9.94G [00:06<00:33, 255MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  15% 1.45G/9.94G [00:06<00:33, 256MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  15% 1.48G/9.94G [00:07<00:33, 255MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  15% 1.51G/9.94G [00:07<00:33, 250MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  16% 1.54G/9.94G [00:07<00:34, 246MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  16% 1.57G/9.94G [00:07<00:33, 250MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  16% 1.60G/9.94G [00:07<00:32, 259MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  16% 1.64G/9.94G [00:07<00:43, 193MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  17% 1.67G/9.94G [00:07<00:46, 176MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  17% 1.70G/9.94G [00:08<00:43, 188MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  17% 1.73G/9.94G [00:08<00:38, 212MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  18% 1.76G/9.94G [00:08<00:38, 215MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  18% 1.79G/9.94G [00:08<00:36, 221MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  18% 1.82G/9.94G [00:08<00:34, 238MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  19% 1.86G/9.94G [00:08<00:32, 252MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  19% 1.89G/9.94G [00:08<00:31, 258MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  19% 1.92G/9.94G [00:08<00:29, 268MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  20% 1.95G/9.94G [00:09<00:28, 277MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  20% 1.98G/9.94G [00:09<00:28, 281MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  20% 2.01G/9.94G [00:09<00:27, 284MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  21% 2.04G/9.94G [00:09<00:27, 291MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  21% 2.08G/9.94G [00:09<00:26, 292MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  21% 2.11G/9.94G [00:09<00:26, 294MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  22% 2.14G/9.94G [00:09<00:26, 291MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  22% 2.17G/9.94G [00:09<00:26, 288MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  22% 2.20G/9.94G [00:09<00:26, 289MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  22% 2.23G/9.94G [00:10<00:26, 289MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  23% 2.26G/9.94G [00:10<00:27, 284MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  23% 2.30G/9.94G [00:10<00:27, 273MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  23% 2.33G/9.94G [00:10<00:29, 256MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  24% 2.36G/9.94G [00:10<00:29, 257MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  24% 2.39G/9.94G [00:10<00:29, 253MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  24% 2.42G/9.94G [00:10<00:28, 262MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  25% 2.45G/9.94G [00:10<00:28, 259MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  25% 2.49G/9.94G [00:11<00:29, 254MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  25% 2.52G/9.94G [00:11<00:30, 245MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  26% 2.55G/9.94G [00:11<00:29, 248MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  26% 2.58G/9.94G [00:11<00:28, 259MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  26% 2.61G/9.94G [00:11<00:30, 240MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  27% 2.64G/9.94G [00:11<00:28, 253MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  27% 2.67G/9.94G [00:11<00:29, 248MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  27% 2.71G/9.94G [00:11<00:28, 254MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  28% 2.74G/9.94G [00:12<00:28, 253MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  28% 2.77G/9.94G [00:12<00:27, 256MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  28% 2.80G/9.94G [00:12<00:28, 254MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  28% 2.83G/9.94G [00:12<00:28, 254MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  29% 2.86G/9.94G [00:12<00:28, 253MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  29% 2.89G/9.94G [00:12<00:43, 160MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  30% 2.94G/9.94G [00:13<00:35, 198MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  30% 2.97G/9.94G [00:13<00:33, 209MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  30% 3.00G/9.94G [00:13<00:32, 213MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  30% 3.03G/9.94G [00:13<00:30, 223MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  31% 3.06G/9.94G [00:13<00:30, 229MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  31% 3.09G/9.94G [00:13<00:31, 218MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  31% 3.12G/9.94G [00:13<00:32, 210MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  32% 3.16G/9.94G [00:14<00:31, 213MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  32% 3.19G/9.94G [00:14<00:31, 217MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  32% 3.22G/9.94G [00:14<00:30, 221MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  33% 3.25G/9.94G [00:14<00:29, 227MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  33% 3.28G/9.94G [00:14<00:28, 232MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  33% 3.31G/9.94G [00:14<00:28, 236MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  34% 3.34G/9.94G [00:14<00:26, 250MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  34% 3.38G/9.94G [00:14<00:26, 249MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  34% 3.41G/9.94G [00:15<00:26, 244MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  35% 3.44G/9.94G [00:15<00:26, 244MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  35% 3.47G/9.94G [00:15<00:26, 246MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  35% 3.50G/9.94G [00:15<00:26, 240MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  36% 3.53G/9.94G [00:15<00:25, 247MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  36% 3.57G/9.94G [00:15<00:25, 252MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  36% 3.60G/9.94G [00:15<00:25, 254MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  36% 3.63G/9.94G [00:15<00:25, 252MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  37% 3.66G/9.94G [00:16<00:25, 249MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  37% 3.69G/9.94G [00:16<00:24, 252MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  37% 3.72G/9.94G [00:16<00:24, 255MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  38% 3.75G/9.94G [00:16<00:24, 254MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  38% 3.79G/9.94G [00:16<00:24, 254MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  38% 3.82G/9.94G [00:16<00:24, 252MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  39% 3.85G/9.94G [00:16<00:24, 250MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  39% 3.88G/9.94G [00:16<00:24, 245MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  39% 3.91G/9.94G [00:17<00:24, 251MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  40% 3.94G/9.94G [00:17<00:23, 252MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  40% 3.97G/9.94G [00:17<00:24, 241MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  40% 4.01G/9.94G [00:17<00:24, 245MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  41% 4.04G/9.94G [00:17<00:33, 178MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  41% 4.07G/9.94G [00:17<00:30, 196MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  41% 4.10G/9.94G [00:17<00:26, 218MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  42% 4.13G/9.94G [00:18<00:25, 225MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  42% 4.16G/9.94G [00:18<00:27, 211MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  42% 4.19G/9.94G [00:18<00:27, 208MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  42% 4.23G/9.94G [00:18<00:27, 208MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  43% 4.26G/9.94G [00:18<00:26, 211MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  43% 4.29G/9.94G [00:18<00:26, 217MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  43% 4.32G/9.94G [00:18<00:24, 231MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  44% 4.35G/9.94G [00:19<00:23, 238MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  44% 4.38G/9.94G [00:19<00:23, 242MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  44% 4.41G/9.94G [00:19<00:22, 246MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  45% 4.45G/9.94G [00:19<00:21, 256MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  45% 4.48G/9.94G [00:19<00:21, 256MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  45% 4.51G/9.94G [00:19<00:21, 254MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  46% 4.54G/9.94G [00:19<00:22, 244MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  46% 4.57G/9.94G [00:19<00:21, 250MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  46% 4.60G/9.94G [00:20<00:20, 255MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  47% 4.63G/9.94G [00:20<00:20, 260MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  47% 4.67G/9.94G [00:20<00:20, 261MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  47% 4.70G/9.94G [00:20<00:20, 259MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  48% 4.73G/9.94G [00:20<00:19, 266MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  48% 4.76G/9.94G [00:20<00:18, 274MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  48% 4.79G/9.94G [00:20<00:19, 268MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  49% 4.82G/9.94G [00:20<00:18, 273MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  49% 4.85G/9.94G [00:20<00:18, 278MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  49% 4.89G/9.94G [00:21<00:18, 281MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  49% 4.92G/9.94G [00:21<00:18, 273MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  50% 4.95G/9.94G [00:21<00:17, 279MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  50% 4.98G/9.94G [00:21<00:17, 281MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  50% 5.01G/9.94G [00:21<00:17, 284MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  51% 5.04G/9.94G [00:21<00:17, 283MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  51% 5.08G/9.94G [00:21<00:17, 282MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  51% 5.11G/9.94G [00:21<00:17, 278MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  52% 5.14G/9.94G [00:21<00:17, 279MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  52% 5.17G/9.94G [00:22<00:16, 281MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  52% 5.20G/9.94G [00:22<00:16, 279MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  53% 5.23G/9.94G [00:22<00:16, 285MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  53% 5.26G/9.94G [00:22<00:16, 286MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  53% 5.30G/9.94G [00:22<00:18, 258MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  54% 5.33G/9.94G [00:22<00:18, 243MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  54% 5.36G/9.94G [00:22<00:17, 257MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  54% 5.40G/9.94G [00:22<00:16, 278MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  55% 5.43G/9.94G [00:23<00:18, 244MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  55% 5.46G/9.94G [00:23<00:19, 228MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  55% 5.49G/9.94G [00:23<00:20, 216MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  56% 5.53G/9.94G [00:23<00:20, 218MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  56% 5.56G/9.94G [00:23<00:19, 229MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  56% 5.59G/9.94G [00:23<00:17, 243MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  57% 5.62G/9.94G [00:23<00:16, 257MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  57% 5.65G/9.94G [00:24<00:16, 266MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  57% 5.68G/9.94G [00:24<00:15, 268MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  57% 5.71G/9.94G [00:24<00:15, 274MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  58% 5.75G/9.94G [00:24<00:15, 272MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  58% 5.78G/9.94G [00:24<00:15, 272MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  58% 5.81G/9.94G [00:24<00:14, 277MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  59% 5.84G/9.94G [00:24<00:15, 272MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  59% 5.87G/9.94G [00:24<00:15, 262MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  59% 5.90G/9.94G [00:24<00:15, 258MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  60% 5.93G/9.94G [00:25<00:15, 265MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  60% 5.97G/9.94G [00:25<00:15, 260MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  60% 6.00G/9.94G [00:25<00:15, 250MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  61% 6.03G/9.94G [00:25<00:15, 256MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  61% 6.06G/9.94G [00:25<00:15, 250MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  61% 6.09G/9.94G [00:25<00:15, 254MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  62% 6.12G/9.94G [00:25<00:15, 250MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  62% 6.16G/9.94G [00:25<00:15, 250MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  62% 6.19G/9.94G [00:26<00:15, 250MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  63% 6.22G/9.94G [00:26<00:14, 254MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  63% 6.25G/9.94G [00:26<00:14, 248MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  63% 6.28G/9.94G [00:26<00:14, 255MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  63% 6.31G/9.94G [00:26<00:14, 252MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  64% 6.34G/9.94G [00:26<00:14, 255MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  64% 6.38G/9.94G [00:26<00:14, 252MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  64% 6.41G/9.94G [00:26<00:14, 250MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  65% 6.44G/9.94G [00:27<00:13, 251MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  65% 6.47G/9.94G [00:27<00:13, 255MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  65% 6.50G/9.94G [00:27<00:13, 249MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  66% 6.53G/9.94G [00:27<00:13, 247MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  66% 6.56G/9.94G [00:27<00:14, 237MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  66% 6.60G/9.94G [00:27<00:15, 220MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  67% 6.63G/9.94G [00:27<00:15, 215MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  67% 6.66G/9.94G [00:28<00:15, 214MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  67% 6.69G/9.94G [00:28<00:15, 211MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  68% 6.72G/9.94G [00:28<00:15, 210MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  68% 6.75G/9.94G [00:28<00:15, 209MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  68% 6.78G/9.94G [00:32<02:09, 24.4MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  69% 6.82G/9.94G [00:32<01:33, 33.4MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  69% 6.85G/9.94G [00:32<01:09, 44.7MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  69% 6.87G/9.94G [00:32<00:57, 53.8MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  69% 6.90G/9.94G [00:33<00:43, 70.2MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  70% 6.92G/9.94G [00:33<00:36, 82.4MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  70% 6.94G/9.94G [00:33<00:31, 96.5MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  70% 6.96G/9.94G [00:33<00:26, 111MB/s] \u001b[A\n",
            "Downloading (…)of-00002.safetensors:  70% 6.98G/9.94G [00:33<00:24, 122MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  71% 7.01G/9.94G [00:33<00:19, 147MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  71% 7.05G/9.94G [00:33<00:16, 176MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  71% 7.08G/9.94G [00:33<00:14, 195MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  72% 7.11G/9.94G [00:34<00:13, 217MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  72% 7.14G/9.94G [00:34<00:12, 231MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  72% 7.17G/9.94G [00:34<00:11, 247MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  72% 7.20G/9.94G [00:34<00:10, 252MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  73% 7.24G/9.94G [00:34<00:10, 264MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  73% 7.27G/9.94G [00:34<00:10, 261MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  73% 7.30G/9.94G [00:34<00:09, 269MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  74% 7.33G/9.94G [00:34<00:09, 279MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  74% 7.36G/9.94G [00:34<00:09, 284MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  74% 7.39G/9.94G [00:35<00:08, 286MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  75% 7.42G/9.94G [00:35<00:08, 288MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  75% 7.46G/9.94G [00:35<00:08, 287MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  75% 7.49G/9.94G [00:35<00:08, 292MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  76% 7.52G/9.94G [00:35<00:08, 289MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  76% 7.55G/9.94G [00:35<00:08, 284MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  76% 7.58G/9.94G [00:35<00:08, 281MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  77% 7.61G/9.94G [00:35<00:08, 279MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  77% 7.64G/9.94G [00:35<00:08, 283MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  77% 7.68G/9.94G [00:36<00:08, 273MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  78% 7.71G/9.94G [00:36<00:08, 260MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  78% 7.74G/9.94G [00:36<00:08, 258MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  78% 7.77G/9.94G [00:36<00:08, 265MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  78% 7.80G/9.94G [00:36<00:08, 255MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  79% 7.83G/9.94G [00:36<00:08, 252MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  79% 7.86G/9.94G [00:36<00:08, 240MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  79% 7.90G/9.94G [00:36<00:08, 235MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  80% 7.93G/9.94G [00:37<00:08, 245MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  80% 7.96G/9.94G [00:37<00:08, 247MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  80% 7.99G/9.94G [00:37<00:11, 168MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  81% 8.02G/9.94G [00:37<00:09, 193MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  81% 8.05G/9.94G [00:37<00:08, 217MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  81% 8.08G/9.94G [00:37<00:07, 238MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  82% 8.12G/9.94G [00:37<00:07, 229MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  82% 8.15G/9.94G [00:38<00:07, 240MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  82% 8.18G/9.94G [00:38<00:07, 241MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  83% 8.21G/9.94G [00:38<00:07, 227MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  83% 8.24G/9.94G [00:42<01:12, 23.4MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  83% 8.27G/9.94G [00:42<00:52, 32.0MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  84% 8.30G/9.94G [00:42<00:37, 43.3MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  84% 8.33G/9.94G [00:42<00:31, 52.0MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  84% 8.35G/9.94G [00:43<00:25, 62.5MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  84% 8.37G/9.94G [00:43<00:21, 74.7MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  84% 8.39G/9.94G [00:43<00:17, 87.8MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  85% 8.42G/9.94G [00:43<00:13, 109MB/s] \u001b[A\n",
            "Downloading (…)of-00002.safetensors:  85% 8.44G/9.94G [00:43<00:12, 122MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  85% 8.46G/9.94G [00:43<00:11, 134MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  85% 8.48G/9.94G [00:43<00:10, 145MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  86% 8.50G/9.94G [00:45<00:39, 36.6MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  86% 8.52G/9.94G [00:46<00:46, 30.5MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  86% 8.56G/9.94G [00:46<00:30, 45.5MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  86% 8.58G/9.94G [00:46<00:24, 55.3MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  86% 8.60G/9.94G [00:46<00:20, 66.2MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  87% 8.62G/9.94G [00:46<00:16, 80.8MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  87% 8.65G/9.94G [00:47<00:12, 107MB/s] \u001b[A\n",
            "Downloading (…)of-00002.safetensors:  87% 8.68G/9.94G [00:47<00:09, 130MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  88% 8.70G/9.94G [00:47<00:09, 137MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  88% 8.73G/9.94G [00:47<00:07, 163MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  88% 8.78G/9.94G [00:47<00:05, 204MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  89% 8.81G/9.94G [00:47<00:05, 192MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  89% 8.84G/9.94G [00:48<00:06, 172MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  89% 8.86G/9.94G [00:48<00:06, 172MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  89% 8.89G/9.94G [00:48<00:05, 193MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  90% 8.91G/9.94G [00:48<00:05, 192MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  90% 8.94G/9.94G [00:48<00:05, 198MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  90% 8.98G/9.94G [00:48<00:04, 217MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  91% 9.01G/9.94G [00:48<00:04, 229MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  91% 9.04G/9.94G [00:48<00:03, 232MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  91% 9.07G/9.94G [00:49<00:03, 241MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  92% 9.10G/9.94G [00:49<00:03, 244MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  92% 9.13G/9.94G [00:49<00:03, 257MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  92% 9.16G/9.94G [00:49<00:02, 265MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  92% 9.20G/9.94G [00:49<00:02, 262MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  93% 9.23G/9.94G [00:49<00:02, 263MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  93% 9.26G/9.94G [00:49<00:02, 262MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  93% 9.29G/9.94G [00:49<00:02, 252MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  94% 9.32G/9.94G [00:50<00:02, 244MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  94% 9.35G/9.94G [00:50<00:02, 239MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  94% 9.38G/9.94G [00:50<00:02, 242MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  95% 9.42G/9.94G [00:50<00:02, 238MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  95% 9.45G/9.94G [00:50<00:02, 235MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  95% 9.48G/9.94G [00:50<00:01, 236MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  96% 9.51G/9.94G [00:50<00:01, 240MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  96% 9.54G/9.94G [00:50<00:01, 233MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  96% 9.57G/9.94G [00:51<00:01, 232MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  97% 9.60G/9.94G [00:51<00:01, 237MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  97% 9.64G/9.94G [00:51<00:01, 242MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  97% 9.67G/9.94G [00:51<00:01, 253MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  98% 9.70G/9.94G [00:51<00:00, 248MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  98% 9.73G/9.94G [00:51<00:00, 255MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  98% 9.76G/9.94G [00:51<00:00, 261MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  98% 9.79G/9.94G [00:51<00:00, 263MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  99% 9.83G/9.94G [00:52<00:00, 254MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  99% 9.86G/9.94G [00:52<00:00, 246MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  99% 9.89G/9.94G [00:52<00:00, 248MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors: 100% 9.94G/9.94G [00:52<00:00, 189MB/s]\n",
            "Downloading shards:  50% 1/2 [00:52<00:52, 52.94s/it]\n",
            "Downloading (…)of-00002.safetensors:   0% 0.00/2.18G [00:00<?, ?B/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:   2% 41.9M/2.18G [00:00<00:06, 326MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:   4% 83.9M/2.18G [00:00<00:06, 324MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:   6% 126M/2.18G [00:00<00:06, 313MB/s] \u001b[A\n",
            "Downloading (…)of-00002.safetensors:   7% 157M/2.18G [00:00<00:06, 295MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:   9% 189M/2.18G [00:00<00:07, 256MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  10% 220M/2.18G [00:00<00:07, 270MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  12% 252M/2.18G [00:00<00:06, 277MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  13% 283M/2.18G [00:01<00:06, 273MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  14% 315M/2.18G [00:01<00:06, 270MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  16% 346M/2.18G [00:01<00:06, 271MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  17% 377M/2.18G [00:01<00:06, 277MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  19% 409M/2.18G [00:01<00:06, 277MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  20% 440M/2.18G [00:01<00:06, 279MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  22% 472M/2.18G [00:01<00:06, 277MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  23% 503M/2.18G [00:01<00:06, 277MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  25% 535M/2.18G [00:01<00:05, 277MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  26% 566M/2.18G [00:02<00:05, 275MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  27% 598M/2.18G [00:02<00:05, 281MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  29% 629M/2.18G [00:02<00:05, 283MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  30% 661M/2.18G [00:02<00:05, 289MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  32% 692M/2.18G [00:02<00:05, 285MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  33% 724M/2.18G [00:02<00:05, 281MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  35% 755M/2.18G [00:02<00:05, 284MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  36% 786M/2.18G [00:02<00:04, 291MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  38% 818M/2.18G [00:02<00:04, 291MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  39% 849M/2.18G [00:03<00:04, 281MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  40% 881M/2.18G [00:03<00:04, 274MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  42% 912M/2.18G [00:03<00:04, 260MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  43% 944M/2.18G [00:03<00:04, 252MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  45% 975M/2.18G [00:03<00:04, 255MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  46% 1.01G/2.18G [00:03<00:04, 258MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  48% 1.04G/2.18G [00:03<00:04, 250MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  49% 1.07G/2.18G [00:03<00:04, 257MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  51% 1.10G/2.18G [00:04<00:04, 249MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  52% 1.13G/2.18G [00:04<00:04, 244MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  53% 1.16G/2.18G [00:04<00:04, 246MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  55% 1.20G/2.18G [00:04<00:04, 238MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  56% 1.23G/2.18G [00:04<00:03, 239MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  58% 1.26G/2.18G [00:04<00:03, 237MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  59% 1.29G/2.18G [00:04<00:03, 232MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  61% 1.32G/2.18G [00:04<00:03, 226MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  62% 1.35G/2.18G [00:05<00:03, 230MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  64% 1.38G/2.18G [00:05<00:03, 242MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  65% 1.42G/2.18G [00:05<00:03, 252MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  66% 1.45G/2.18G [00:05<00:04, 174MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  68% 1.48G/2.18G [00:05<00:03, 192MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  69% 1.51G/2.18G [00:05<00:03, 199MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  71% 1.54G/2.18G [00:06<00:03, 179MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  72% 1.56G/2.18G [00:06<00:03, 182MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  73% 1.59G/2.18G [00:06<00:02, 206MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  75% 1.63G/2.18G [00:06<00:02, 217MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  76% 1.66G/2.18G [00:06<00:02, 222MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  77% 1.69G/2.18G [00:06<00:02, 226MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  79% 1.72G/2.18G [00:06<00:01, 234MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  80% 1.75G/2.18G [00:06<00:01, 250MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  82% 1.78G/2.18G [00:07<00:01, 244MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  83% 1.81G/2.18G [00:07<00:01, 249MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  85% 1.85G/2.18G [00:07<00:01, 248MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  86% 1.88G/2.18G [00:07<00:01, 250MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  88% 1.91G/2.18G [00:07<00:01, 252MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  89% 1.94G/2.18G [00:07<00:00, 263MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  90% 1.97G/2.18G [00:07<00:00, 243MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  92% 2.00G/2.18G [00:08<00:00, 228MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  93% 2.03G/2.18G [00:08<00:00, 235MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  95% 2.07G/2.18G [00:09<00:01, 63.3MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  96% 2.10G/2.18G [00:09<00:00, 82.8MB/s]\u001b[A\n",
            "Downloading (…)of-00002.safetensors:  98% 2.14G/2.18G [00:09<00:00, 114MB/s] \u001b[A\n",
            "Downloading (…)of-00002.safetensors: 100% 2.18G/2.18G [00:09<00:00, 220MB/s]\n",
            "Downloading shards: 100% 2/2 [01:02<00:00, 31.46s/it]\n",
            "Loading checkpoint shards: 100% 2/2 [00:57<00:00, 28.76s/it]\n",
            "Downloading (…)neration_config.json: 100% 132/132 [00:00<00:00, 645kB/s]\n",
            "Downloading (…)okenizer_config.json: 100% 199/199 [00:00<00:00, 1.19MB/s]\n",
            "Downloading (…)n/tokenization_yi.py: 100% 8.96k/8.96k [00:00<00:00, 33.0MB/s]\n",
            "A new version of the following files was downloaded from https://huggingface.co/01-ai/Yi-6B:\n",
            "- tokenization_yi.py\n",
            ". Make sure to double-check they do not contain any added malicious code. To avoid downloading new versions of the code file, you can pin a revision.\n",
            "Downloading tokenizer.model: 100% 1.03M/1.03M [00:00<00:00, 170MB/s]\n",
            "2023-11-08 07:12:23.882562: E tensorflow/compiler/xla/stream_executor/cuda/cuda_dnn.cc:9342] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered\n",
            "2023-11-08 07:12:23.882620: E tensorflow/compiler/xla/stream_executor/cuda/cuda_fft.cc:609] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered\n",
            "2023-11-08 07:12:23.882659: E tensorflow/compiler/xla/stream_executor/cuda/cuda_blas.cc:1518] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered\n",
            "2023-11-08 07:12:25.935112: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT\n",
            "Let me tell you an interesting story about cat Tom and mouse Jerry, how they became enemies and how they became friends. It was on the first day of December, my grandma told me that she was going to take our family dog and cat to the vet. Since my grandma needed to buy something and there was no car at home, I volunteered to help by walking the small dog and the house cat. I took both animals out before I woke my mom and dad and said to them, “We have animals outside right now. Would you please go out and take care of them? While they were outside the door was still open. We didn't have a leash for the cat and for the dog I forgot to put a leash on him. I went and put a leash on the dog first and then I tried to leash him up to the cat. When I came outside I saw that the dog was still tied to the tree and the cat was running around looking for mice and other small animals. I tried to get the cat but it was already too late. It had already ran around the house and the yard looking for mice and other small animals; meanwhile our neighbor's dog was tied up to the tree as well and the cat took on the dog like a boss. Our neighbor walked her dog and she was really mad at me because she saw that the cat attacked her dog and she started yelling at me. The cat took on that dog so hard that it scratched the dog's face, ears and legs. While all that was happening, the dog and cat ran around the house, through the flower bed, through the dog house, and we finally caught them.\n",
            "\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "!python demo/text_generation.py --model 01-ai/Yi-6B --tokenizer 01-ai/Yi-6B --max-tokens 512 --eos-token $'\\n' --streaming --prompt '如何学习AI技术'"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "hAGWHxTpu6dS",
        "outputId": "093898b8-efa2-4116-d40d-797f6c588685"
      },
      "execution_count": 4,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Namespace(model='01-ai/Yi-6B', tokenizer='01-ai/Yi-6B', max_tokens=512, streaming=True, prompt='如何学习AI技术', eos_token='\\n')\n",
            "Loading checkpoint shards: 100% 2/2 [00:55<00:00, 27.85s/it]\n",
            "2023-11-08 09:33:20.208884: E tensorflow/compiler/xla/stream_executor/cuda/cuda_dnn.cc:9342] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered\n",
            "2023-11-08 09:33:20.208937: E tensorflow/compiler/xla/stream_executor/cuda/cuda_fft.cc:609] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered\n",
            "2023-11-08 09:33:20.208970: E tensorflow/compiler/xla/stream_executor/cuda/cuda_blas.cc:1518] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered\n",
            "2023-11-08 09:33:22.539511: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT\n",
            "如何学习AI技术？有没有一个路线图让我们能够看得更清楚。\n",
            "\n"
          ]
        }
      ]
    }
  ]
}
